﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PushSharp.Apple;
using PushSharp.Core;
using PushSharp;
using System.IO;

namespace BartonExtension
{
    public static class PushExtension
    {
        public static void pushIOSDeviceNotification(string pwd,string deviceToken,string alert,int badge,string sound)
        {
            var push = new PushBroker();
            var appleCert = File.ReadAllBytes("zker_apns.p12");
            push.RegisterAppleService(new ApplePushChannelSettings(appleCert, pwd));
            push.QueueNotification(new AppleNotification().ForDeviceToken(deviceToken)
                .WithAlert(alert).WithBadge(badge).WithSound(sound));
        }
    }
}
